$NG.AllReady(function (page, { useAction, useBeforeClick, useValuesChange, useClick, useUpdateRow, subscribe, useUpdateRows }) {
    const mstform = $NG.getCmpApi("p_form_fgskp_m")
    const dgrid1 = $NG.getCmpApi("p_form_fgskp_d1")
    const getHeadValue = (str)=>mstform.getItem(str).getValue()

    if(page.oType == 'add'){
        getJcbData1()
    }

    // 获取基础表数据
    function getJcbData1(){
        $NG.execServer("SELECT",{sql:`select u_pjys,u_fz,u_wcqkjysm,u_pf from p_form_kpjcb_d1 d left join p_form_kpjcb_m m on m.phid = d.pphid where m.u_jcblx = '02'`},(res)=>{
            if(res.count == 0)return 
            const datas = JSON.parse(res.data).reduce((value,item)=>{
                value.push(item.extendObjects)
                return value
            },[])
            dgrid1.clearRows().then(()=>{
                dgrid1.addRows(datas)
            })
        })
    }
    
})
